package com.example.administrator.myapplication;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

    public static final String TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Log.v(MainActivity.TAG,"FirstActivity -> onCreate");
        Button startSecondActivity = (Button) findViewById(R.id.btn);
        startSecondActivity.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v){
                Intent intent = new Intent(MainActivity.this,SecondActivity.class);
                startActivity(intent);
            }
        });
    }

    @Override
    protected void onStart(){
        super.onStart();
        Log.d(TAG, "FirstActivity -> onStart");
    }

    @Override
    protected void onResume(){
        super.onResume();
        Log.d(TAG, "FirstActivity -> onResume");
    }

    @Override
    protected void onPause(){
        super.onPause();
        Log.d(TAG, "FirstActivity -> onPause");
    }

    @Override
    protected void onStop(){
        super.onStop();
        Log.d(TAG, "FirstActivity -> onStop");
    }

    @Override
    protected void onDestroy(){
        super.onDestroy();
        Log.d(TAG, "FirstActivity -> onDestroy");
    }

    @Override
    protected void onRestart(){
        super.onRestart();
        Log.d(TAG, "FirstActivity -> onRestart");
    }
}


